import React, {useState} from 'react';
import PropTypes from "prop-types";
function Child(props) {
	const [age,setAge] = useState(props.age);
	return (
		<div>
			<h3>Child</h3>
			<p>userName:{props.userName}</p>
			<p>age:{props.age}</p>
			<button onClick={()=>props.setAge(props.age+1)}>{props.age}</button>
		</div>
	);
}
Child.propTypes = {
	age:PropTypes.number,
	userName:PropTypes.string
}
Child.defaultProps = {
	age:1000
}

export default Child;